package com.jwater.core.serialize;

/**
 * @description:
 * @author: jnner
 * @createDate: 2021/2/5
 * @version: 1.0
 */
public class SerializeUtils {
    /**
     * simple序列化类序列化数组
     *
     * @param objs
     * @return
     */
    public static byte[] serializeArray(Object... objs) {
        SerializeService serializeService = SerializeFactory
                .getSerializeService(SerializeFactory.SERIALIZE_TYPE_SIMPLE);
        return serializeService.serializeArray(objs);
    }

    /**
     * simple序列化类反序列化数组
     *
     * @param data
     * @return
     */
    public static Object[] deserializeArray(byte[] data) {
        SerializeService serializeService = SerializeFactory
                .getSerializeService(SerializeFactory.SERIALIZE_TYPE_SIMPLE);
        return serializeService.deserializeArray(data);
    }
}
